/**
 * 
 */
package t4j.holding;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;

/**
 * @author sz
 *
 * create time：2012-9-28
 */
public class LinkedListFeatures {

	public static void main(String[] args) {
		LinkedList<Integer> pets = new LinkedList<Integer>(Arrays.asList(1,2,3,4,5));
		
		System.out.println(pets);
		
		System.out.println("pets.getFirst()"+pets.getFirst());
		
		System.out.println("pets.element()"+pets.element());
		System.out.println("pets.peek()"+pets.peek());
		
		System.out.println("pets.remove()"+pets.remove());
		System.out.println("pets.removeFirst()"+pets.removeFirst());
		System.out.println("pets.poll()"+pets.poll());
		System.out.println(pets);
		
		pets.addFirst(1);
		System.out.println("After addFirst" + pets);
		
		pets.offer(2);
		System.out.println("after offer" + pets);//  将指定元素添加到此列表的末尾（最后一个元素）。
		
		pets.add(3);
		System.out.println("after add" + pets);//将指定元素添加到此列表的结尾。
		
		pets.addLast(6);
		System.out.println("after addlast" +pets);
		
		
		System.out.println("pets.removeLast()" + pets.removeLast() );
	}
}
